package com.zjc.yohoshop.network;

import com.zjc.yohoshop.bean.BrandEntity;
import com.zjc.yohoshop.bean.CategoryEntity;
import com.zjc.yohoshop.bean.CategotyHotEntity;
import com.zjc.yohoshop.bean.HomeBannerEntity;
import com.zjc.yohoshop.bean.HomeGoodsEntity;
import com.zjc.yohoshop.bean.HomeMenuEntity;
import com.zjc.yohoshop.bean.HomeRecommendEntity;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;

/**
 * 项目中网络请求接口入口
 * */
public interface API {

    public final static String BaseUrl = "http://169.254.134.250/yoho";

    /**
     *首页菜单接口
     * http://169.254.134.250/yoho/home_menu.php
     * */
    @GET("home_menu.php")
    Observable<HomeMenuEntity> home_menu_request();



    /**
     * 首页广告接口
     */
    @GET("Home_banner.php")
    Observable<HomeBannerEntity> home_banner_request();

    /**
     * 首页推荐接口
     */
    @FormUrlEncoded
    @POST("home_recommend.php")
    Observable<HomeRecommendEntity> home_recommend_request(@Field("request")String request);

    /**
     * 首页列表接口
     */
    @FormUrlEncoded
    @POST("home_goods.php")
    Observable<HomeGoodsEntity> home_goods_request(@Field("request")String request);

    //品类接口:
    @FormUrlEncoded
    @POST("category_all.php")
    Observable<CategoryEntity>postCategoryList(@Field("request")String request);
    //品类商品接口:
    @FormUrlEncoded
    @POST("category_goods.php")
    Observable<CategotyHotEntity> postCategoryHot(@Field("request")String request);
    //品牌列表接口:
    @FormUrlEncoded
    @POST("brand_list.php")
    Observable<BrandEntity>postBrand(@Field("request")String request);

}
